package com.hunttown.mes.manage.service;

import com.hunttown.mes.rpc.api.AnalysisManageClickLogRpcService;
import com.hunttown.mes.rpc.domain.query.AnalysisManageClickLogDTOQuery;
import com.hunttown.common.domain.Page;
import com.hunttown.mes.rpc.domain.AnalysisManageClickLogDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * created by wangjunfu on 2018-11-26 15:05:14
 */
@Service
public class AnalysisManageClickLogManageService {

    private final static Logger logger = LoggerFactory.getLogger(AnalysisManageClickLogManageService.class);

    private final AnalysisManageClickLogRpcService rpcService;

    @Autowired
    public AnalysisManageClickLogManageService(AnalysisManageClickLogRpcService rpcService) {
        this.rpcService = rpcService;
    }

    // 新增
    public AnalysisManageClickLogDTO insert(AnalysisManageClickLogDTO objDTO) {
        return rpcService.insert(objDTO);
    }

    // 通过ID修改
    public Boolean updateInfoById(AnalysisManageClickLogDTO objDTO) {
        return rpcService.updateInfoById(objDTO);
    }

    // 通过Query修改
    public Boolean updateInfoByQuery(AnalysisManageClickLogDTOQuery objDTOQuery) {
        return rpcService.updateInfoByQuery(objDTOQuery);
    }

    // 通过ID删除
    public Boolean delete(Integer id) {
        return rpcService.deleteById(id);
    }

    // 通过ID获取
    public AnalysisManageClickLogDTO getById(Integer id) {
        if (id <= 0) {
            return null;
        }
        return rpcService.selectById(id);
    }

    // 通过Query获取
    public AnalysisManageClickLogDTO getByQuery(AnalysisManageClickLogDTOQuery objDTOQuery) {
        return rpcService.selectObjByQuery(objDTOQuery);
    }

    // 获取分页列表
    public Page<AnalysisManageClickLogDTO> getForPage(AnalysisManageClickLogDTOQuery objDTOQuery) {
        return rpcService.getListForPage(objDTOQuery);
    }
}